﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOADAL;
using System.Data.SqlClient;
public partial class page_NewsShowIframe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // 没有加入用户判断 修改时需修改sql语句


        SqlConnection conn = SQLManager.GetConn();
        SqlDataAdapter myda = new SqlDataAdapter("SELECT News.Id as newsId, News.Title as newsTitle,News.newsDate as issueTime FROM news where state=1 order by newsDate desc", conn);
        DataSet myds = new DataSet();
        myda.Fill(myds, "lis");
        GridView1.DataSource = myds;
//        GridView1.DataKeyNames = new string[] { "id" };
        GridView1.DataBind();

    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.DataBind();
    }
}
